package cn.edu.sju;

import java.io.FileOutputStream;
import java.io.IOException;
import java.io.ObjectOutputStream;

public class SerializableObj
{
    
    public static void main(String[] args)
    {
        ObjectOutputStream oos=null;
        try {
            oos=new ObjectOutputStream(new FileOutputStream("C:\\myDoc\\stu.txt"));
            Student stu=new Student(null, 0, null);
            oos.writeObject(stu);
        }catch(IOException ex) {
            ex.printStackTrace();
        }finally{
            if(oos!=null) {
                try {
                    oos.close();
                }catch(IOException e) {
                    e.printStackTrace();
                }
            }
        }
        System.out.println("");

        
    }
    
}
